<!DOCTYPE html>
<html lang='en'>
<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script type='text/javascript' src='js/vue.js'></script>

    <script src="../axios/axios.min.js"></script>
</head>
<body>
    <div id='app'>
        {{msg}}====={{result}}
    </div>
    <script type='text/javascript'>
        var vm = new Vue({
            el: '#app',
            data: {
                msg: 'Hello Vue',
                result:''
            },
            methods:{
                async aa(){
                    const  {data:res}=await axios('http://127.0.0.1:3000/fdata')
                    this.result=res
                }
            },
            async created(){
                this.aa()
                /* 演变1 */
                // axios('http://127.0.0.1:3000/fdata').then(res=>{
                //     console.log(res,123);
                //     this.result=res.data
                // })

                /* 演变2 */
                // const  {data:res}=await axios('http://127.0.0.1:3000/fdata')
                // this.result=res

            },
            mounted(){
                
            }


        });
    </script>
</body>
</html>